package com.springboot.blog.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.springboot.blog.beans.AdminUser;
import com.springboot.blog.beans.Blog;
import com.springboot.blog.beans.RoleName;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface AdminUserDao extends BaseMapper<AdminUser> {

    /**
     * 根据用户名查找用户
     * @param username
     * @return
     * @throws Exception
     */
    public AdminUser queryUserByUsername(String username)throws Exception;

    /**
     * 新增用户名
     */
    public int findAdmin(@Param("blogUsername") String userName,@Param("blogPassword") String userPwd,@Param("blogPhone")String  userPhone,@Param("blogNickName") String nickName, @Param("blogPwdSalt") String pwdSalt);

    /**
     * 根据用户名和电话号码查询用户信息
     */
    public AdminUser findAdminAndPhone(@Param("blogUsername") String userName,@Param("blogPhone") String userPhone);
    /**
     * 找回用户密码
     */
    public Boolean updateAdmin(@Param("blogUsername") String userName, @Param("blogPassword") String blogPassword,@Param("blogPwdSalt") String pwdSalt);

}
